package base.exception;

public class Hero {
	  String name; //姓名
      
	    float hp; //血量
	        
	    float armor; //护甲
	        
	    int moveSpeed; //移动速度
	     

	    public Hero(){
	        System.out.println("Hero的无参的构造方法 ");
	    }
	    public void actackHero(Hero h) throws ExceptionSduty{
	    	if(h.hp<=0){
	    		throw new ExceptionSduty("123");
	    	}
	    }
	     
	    public static void main(String[] args) {
	    	Hero a= new Hero();
	    	Hero b= new Hero();
	    	b.hp=-10;
	    	try {
				a.actackHero(b);
			} catch (ExceptionSduty e) {
				System.out.println(""+e.getMessage());
				
			}
	    }
	      
}
